import Vue from 'vue'
import Vuex from 'vuex'
import vuexPersistedstate from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userInfo: {}, // 用户信息
    account: 0, // 用户金额
    spinShow: false
  },
  mutations: {
    setUserInfo (state, user) {
      state.userInfo = user
    },
    setAccount (state, account) {
      state.account = account
    },
    setSpinShow (state, val) {
      state.spinShow = val
    }
  },
  actions: {

  },
  plugins: [vuexPersistedstate()]
})
